<?php
/*
http://www.gnu.de/gpl-ger.html
*/
clearstatcache();

// required files!
require("config.php");
require("includes/security-inc.php");
require("includes/classes-inc.php");
require("lang/".$language.".php");
require("includes/session-inc.php");
require("includes/button-inc.php");

// needed strings
$CURRENTPATH = PATH.": /".$getpath;
if($_SERVER['argv'][0] == ""){
    $FORMPATH = basename($_SERVER[SCRIPT_FILENAME]);
}else{
    $FORMPATH = basename($_SERVER[SCRIPT_FILENAME])."?".$_SERVER['argv'][0];
}

// insert data into template
$xhtml = new read_template("templates/index.tmpl");
$xhtml = str_replace("{TITLE}",TITLE,$xhtml->template);
$xhtml = str_replace("{VERSION}",VERSION,$xhtml);
$xhtml = str_replace("{VERNUM}",VERNUM,$xhtml);
$xhtml = str_replace("{CURRENT_PATH}",$CURRENTPATH,$xhtml);
$xhtml = str_replace("{FORM_PATH}",$FORMPATH,$xhtml);
$xhtml = str_replace("{ACTION_BUTTONS}",$xhtmlbuttons,$xhtml);
$tl = new listing($fullpath,$showhidden,$permtype,$getpath);
$xhtml = str_replace("{DIRECTORY_LISTING}",$tl->tablelisting,$xhtml);
$xhtml = str_replace("{NAME}",NAME,$xhtml);
$xhtml = str_replace("{SIZE}",SIZE,$xhtml);
$xhtml = str_replace("{DATE}",DATE,$xhtml);
$xhtml = str_replace("{PERM}",PERM,$xhtml);
$xhtml = str_replace("{USER}",USER,$xhtml);
$xhtml = str_replace("{GROUP}",GROUP,$xhtml);
require("includes/clipping-inc.php");
$xhtml = str_replace("{CLIPBOARD}",$xhtmlclipping,$xhtml);

// output the xhtml mess
echo $xhtml;

?>
